home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / ModEditCurvesMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  20.8 KB  |  781 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  26 June 1998
  22. // Author:         mgr
  23. //
  24. //
  25. //  Procedure Name:
  26. //      ModEditCurvesMenu
  27. //
  28. //  Description:
  29. //        Create the MODELLING->Edit Curves menu
  30. //
  31. //  Input Arguments:
  32. //      parent to parent the menu to.
  33. //
  34. //  Return Value:
  35. //      None.
  36. //
  37.  
  38. proc modEditCurvesMenuLabel( int $hasSurfaces )
  39. {
  40.     if( $hasSurfaces ) {
  41.         if( `optionVar -q modelWithToolDuplCurve` ) {
  42.             menuItem -e
  43.                 -l "Duplicate Surface Curves Tool"
  44.                 -annotation ("Duplicate Surface Curves Tool" +
  45.                              ": Select surface curve(s)")
  46.                 duplicateCurveItem ;
  47.             menuItem -e
  48.                 -annotation ("Duplicate Curves Tool Box")
  49.                 -l ("Duplicate Curves Tool Option Box")
  50.                 duplicateCurveDialogItem;
  51.         }
  52.         else {
  53.             menuItem -e
  54.                 -l "Duplicate Surface Curves"
  55.                 -annotation ("Duplicate Surface Curves" +
  56.                              ": Select surface curve(s)")
  57.                 duplicateCurveItem ;
  58.             menuItem -e
  59.                 -annotation ("Duplicate Curves Box")
  60.                 -l ("Duplicate Curves Option Box")
  61.                 duplicateCurveDialogItem;
  62.         }
  63.     }
  64.  
  65.     if( `optionVar -q modelWithToolAttachCurve` ) {
  66.         menuItem -e
  67.           -l "Attach Curves Tool"
  68.           -annotation ("Attach Curves Tool: Select two curves")
  69.           attachCrvItem;
  70.         menuItem -e
  71.           -annotation ("Attach Curves Tool Option Box")
  72.           -l ("Attach Curves Tool Option Box")
  73.           attachCrvDialog;
  74.     }
  75.     else {
  76.         menuItem -e
  77.           -l "Attach Curves"
  78.           -annotation ("Attach Curves: Select two curves")
  79.           attachCrvItem;
  80.         menuItem -e
  81.           -annotation ("Attach Curves Option Box")
  82.           -l ("Attach Curves Option Box")
  83.           attachCrvDialog;
  84.     }
  85.  
  86.     if( `optionVar -q modelWithToolAlignCurve` ) {
  87.         menuItem -e
  88.             -l "Align Curves Tool" 
  89.             -annotation "Align Curves Tool: Select two curves"
  90.             alignItem;
  91.         menuItem -e
  92.             -annotation "Align Curves Tool Option Box"
  93.             -l "Align Curves Tool Option Box"
  94.             alignDialogItem;
  95.     }
  96.     else {
  97.         menuItem -e
  98.             -l "Align Curves" 
  99.             -annotation "Align Curves: Select two curves"
  100.             alignItem;
  101.         menuItem -e
  102.             -annotation "Align Curves Option Box"
  103.             -l "Align Curves Option Box"
  104.             alignDialogItem;
  105.     }
  106.  
  107.     if( `optionVar -q modelWithToolDetachCurve` ) {
  108.         menuItem -e
  109.           -l "Detach Curves Tool"
  110.           -annotation ("Detach Curves Tool" +
  111.                        ": Select curve parameter point(s)")
  112.           detachItem;
  113.         menuItem -e
  114.           -annotation ("Detach Curves Tool Option Box")
  115.           -l ("Detach Curves Tool Option Box")
  116.           detachDialog;
  117.     }
  118.     else {
  119.         menuItem -e
  120.           -l "Detach Curves"
  121.           -annotation ("Detach Curves" +
  122.                        ": Select curve parameter point(s)")
  123.           detachItem;
  124.         menuItem -e
  125.           -annotation ("Detach Curves Option Box")
  126.           -l ("Detach Curves Option Box")
  127.           detachDialog;
  128.     }
  129.  
  130.     if( `optionVar -q modelWithToolInsertCurve` ) {
  131.         menuItem -e
  132.           -l "Insert Knot Tool"
  133.           -annotation ("Insert Knot Tool" +
  134.                        ": Select curve parameter point(s)")
  135.           insertItem;
  136.         menuItem -e
  137.           -annotation ("Insert Knot Tool Option Box")
  138.           -l ("Insert Knot Tool Option Box")
  139.           insertDialog;
  140.     }
  141.     else {
  142.         menuItem -e
  143.           -l "Insert Knot"
  144.           -annotation ("Insert Knot" +
  145.                        ": Select curve parameter point(s)")
  146.           insertItem;
  147.         menuItem -e
  148.           -annotation ("Insert Knot Option Box")
  149.           -l ("Insert Knot Option Box")
  150.           insertDialog;
  151.     }
  152.  
  153.     if( `optionVar -q modelWithToolFilletCurve` ) {
  154.         menuItem -e
  155.             -label "Curve Fillet Tool"
  156.             -annotation "Curve Fillet Tool: Select curve parameter points"
  157.             crvFilletItem;
  158.         menuItem -e
  159.             -annotation "Curve Fillet Tool Option Box"
  160.             -l "Curve Fillet Tool Option Box"
  161.             crvFilletDialogItem;
  162.     }
  163.     else {
  164.         menuItem -e
  165.             -label "Curve Fillet"
  166.             -annotation "Curve Fillet: Select curve parameter points"
  167.             crvFilletItem;
  168.         menuItem -e
  169.             -annotation "Curve Fillet Option Box"
  170.             -l "Curve Fillet Option Box"
  171.             crvFilletDialogItem;
  172.     }
  173.  
  174.     if( `optionVar -q modelWithToolOffsetCurve` ) {
  175.         menuItem -e
  176.             -l "Offset Curve Tool"
  177.             -annotation ("Offset Curve Tool: Select a curve, " +
  178.                          "curve on surface, isoparm or trim edge")
  179.             offsetCrvItem;
  180.  
  181.         menuItem -e
  182.             -annotation "Offset Curve Tool Option Box"
  183.             -l "Offset Curve Tool Option Box"
  184.             offsetCurveDialogItem;
  185.     }
  186.     else {
  187.         menuItem -e
  188.             -l "Offset Curve"
  189.             -annotation ("Offset Curve: Select a curve, " +
  190.                          "curve on surface, isoparm or trim edge")
  191.             offsetCrvItem;
  192.  
  193.         menuItem -e
  194.             -annotation "Offset Curve Option Box"
  195.             -l "Offset Curve Option Box"
  196.             offsetCurveDialogItem;
  197.     }
  198.  
  199.     if( $hasSurfaces ) {
  200.         if( `optionVar -q modelWithToolOffsetCoS` ) {
  201.             menuItem -e
  202.                 -l "Offset Curve On Surface Tool"
  203.                 -annotation ("Offset Curve On Surface Tool: " +
  204.                              "Select a curve on surface, isoparm or trim edge")
  205.                 offsetCosItem;
  206.             menuItem -e
  207.                 -annotation "Offset Curve On Surface Tool Option Box"
  208.                 -l "Offset Curve On Surface Tool Option Box"
  209.                 offsetCosDialogItem;
  210.         }
  211.         else {
  212.             menuItem -e
  213.                 -l "Offset Curve On Surface"
  214.                 -annotation ("Offset Curve On Surface: " +
  215.                              "Select a curve on surface, isoparm or trim edge")
  216.                 offsetCosItem;
  217.             menuItem -e
  218.                 -annotation "Offset Curve On Surface Option Box"
  219.                 -l "Offset Curve On Surface Option Box"
  220.                 offsetCosDialogItem;
  221.         }
  222.     }
  223.  
  224.     if( `optionVar -q modelWithToolExtendCurve` ) {
  225.         menuItem -e
  226.             -l "Extend Curve Tool"
  227.             -annotation ("Extend Curve Tool: Select curve(s) " +
  228.                          "or curve on surface(s)")
  229.             extendCurveItem;
  230.         menuItem -e
  231.             -annotation "Extend Curve Tool Option Box"
  232.             -l "Extend Curve Tool Option Box"
  233.             extendCurveDialogItem;
  234.     }
  235.     else {
  236.         menuItem -e
  237.             -l "Extend Curve"
  238.             -annotation "Extend Curve: Select curve(s) or curve on surface(s)"
  239.             extendCurveItem;
  240.         menuItem -e
  241.             -annotation "Extend Curve Option Box"
  242.             -l "Extend Curve Option Box"
  243.             extendCurveDialogItem;
  244.     }
  245.  
  246.     if( $hasSurfaces ) {
  247.         if( `optionVar -q modelWithToolExtendCosCurve` ) {
  248.             menuItem -e
  249.                 -l "Extend Curve On Surface Tool"
  250.                 -annotation ("Extend Curve On Surface Tool: " +
  251.                              "Select curve(s) on surface")
  252.                 extendCosCurveItem;
  253.             menuItem -e
  254.                 -annotation "Extend Curve On Surface Tool Option Box"
  255.                 -l "Extend Curve On Surface Tool Option Box"
  256.                 extendCosCurveDialogItem;
  257.         }
  258.         else {
  259.             menuItem -e
  260.                 -l "Extend Curve On Surface"
  261.                 -annotation ("Extend Curve On Surface: Select " +
  262.                              "curve(s) on surface")
  263.                 extendCosCurveItem;
  264.             menuItem -e
  265.                 -annotation "Extend Curve On Surface Option Box"
  266.                 -l "Extend Curve On Surface Option Box"
  267.                 extendCosCurveDialogItem;
  268.         }
  269.     }
  270.  
  271.     if( `optionVar -q modelWithToolCloseCurve` ) {
  272.         menuItem -e
  273.             -l "Open/Close Curves Tool"
  274.             -annotation "Open/Close Curves Tool: Select curve(s)"
  275.             closeItem;
  276.         menuItem -e
  277.             -annotation "Open/Close Curves Tool Option Box"
  278.             -l "Open/Close Curves Tool Option Box"
  279.             closeDialogItem;
  280.     }
  281.     else {
  282.         menuItem -e
  283.             -l "Open/Close Curves"
  284.             -annotation "Open/Close Curves: Select curve(s)"
  285.             closeItem;
  286.         menuItem -e
  287.             -annotation "Open/Close Curves Option Box"
  288.             -l "Open/Close Curves Option Box"
  289.             closeDialogItem;
  290.     }
  291.  
  292.     if( `optionVar -q modelWithToolReverseCurve` ) {
  293.         menuItem -e
  294.             -l "Reverse Curve Direction Tool"
  295.             -annotation "Reverse Curves Tool: Select curve(s)"
  296.             reverseItem;
  297.  
  298.         menuItem -e
  299.             -annotation "Reverse Curves Tool Option Box"
  300.             -l "Reverse Curves Tool Option Box"
  301.             reverseDialogItem;
  302.     }
  303.     else {
  304.         menuItem -e
  305.             -l "Reverse Curve Direction"
  306.             -annotation "Reverse Curves: Select curve(s)"
  307.             reverseItem;
  308.  
  309.         menuItem -e
  310.             -annotation "Reverse Curves Option Box"
  311.             -l "Reverse Curves Option Box"
  312.             reverseDialogItem;
  313.     }
  314.  
  315.     if( `optionVar -q modelWithToolRebuildCurve` ) {
  316.         menuItem -e
  317.             -l "Rebuild Curve Tool"
  318.             -annotation ("Rebuild Curve Tool: Select curve(s) " +
  319.                          "or curve on surface(s)")
  320.             rebuildCrvItem;
  321.         menuItem -e
  322.             -annotation "Rebuild Curve Tool Option Box"
  323.             -l "Rebuild Curve Tool Option Box"
  324.             rebuildCurveDialogItem;
  325.     }
  326.     else {
  327.         menuItem -e
  328.             -l "Rebuild Curve"
  329.             -annotation "Rebuild Curve: Select curve(s) or curve on surface(s)"
  330.             rebuildCrvItem;
  331.         menuItem -e
  332.             -annotation "Rebuild Curve Option Box"
  333.             -l "Rebuild Curve Option Box"
  334.             rebuildCurveDialogItem;
  335.     }
  336.  
  337.     if( `optionVar -q modelWithToolCutCurve` ) {
  338.         menuItem -e
  339.             -l "Cut Curve Tool"
  340.             -annotation "Cut Curve Tool: Cuts two curves where they intersect"
  341.             cutCurvesItem;
  342.         menuItem -e
  343.             -annotation "Cut Curve Tool Option Box"
  344.             -l "Cut Curve Tool Option Box"
  345.             cutCurveDialogItem;
  346.     }
  347.     else {
  348.         menuItem -e
  349.             -l "Cut Curve"
  350.             -annotation "Cut Curve: Cuts two curves where they intersect"
  351.             cutCurvesItem;
  352.         menuItem -e
  353.             -annotation "Cut Curve Option Box"
  354.             -l "Cut Curve Option Box"
  355.             cutCurveDialogItem;
  356.     }
  357.  
  358.     if( `optionVar -q modelWithToolIntersectCurve` ) {
  359.         menuItem -e
  360.             -l "Intersect Curves Tool"
  361.             -annotation ("Intersect Curves Tool: Select two or more " +
  362.                          "curves - the last curve intersects all " +
  363.                          "the other ones")
  364.             intersectCurvesItem;
  365.         menuItem -e
  366.             -annotation "Intersect Curves Tool Option Box"
  367.             -l "Intersect Curves Tool Option Box"
  368.             intersectCurveDialogItem;
  369.     }
  370.     else {
  371.         menuItem -e
  372.             -l "Intersect Curves"
  373.             -annotation ("Intersect Curves: Select two or more " +
  374.                          "curves - the last curve intersects all " +
  375.                          "the other ones")
  376.             intersectCurvesItem;
  377.         menuItem -e
  378.             -annotation "Intersect Curves Option Box"
  379.             -l "Intersect Curves Option Box"
  380.             intersectCurveDialogItem;
  381.     }
  382.  
  383.     if( `optionVar -q modelWithToolFitBspline` ) {
  384.         menuItem -e
  385.             -l "Fit B-spline Tool"
  386.             -annotation ("Fit B-spline Tool: Select curve(s), " +
  387.                          "isoparm(s) or trim edge(s)")
  388.             fitBsplineItem;
  389.  
  390.         menuItem -e
  391.             -annotation "Fit B-spline Tool Option Box"
  392.             -l "Fit B-spline Tool Option Box"
  393.             fitBsplineDialogItem;
  394.     }
  395.     else {
  396.         menuItem -e
  397.             -l "Fit B-spline"
  398.             -annotation ("Fit B-spline: Select curve(s), " +
  399.                          "isoparm(s) or trim edge(s)")
  400.             fitBsplineItem;
  401.  
  402.         menuItem -e
  403.             -annotation "Fit B-spline Option Box"
  404.             -l "Fit B-spline Option Box"
  405.             fitBsplineDialogItem;
  406.     }
  407.  
  408.     if( `optionVar -q modelWithToolSmoothCurve` ) {
  409.         menuItem -e
  410.             -l "Smooth Curve Tool"
  411.             -annotation "Smooth Curve Tool: Select control vertices on curve"
  412.             smoothItem;
  413.         menuItem -e
  414.             -annotation "Smooth Curve Tool Option Box"
  415.             -l "Smooth Curve Tool Option Box"
  416.             smoothDialogItem;
  417.     }
  418.     else {
  419.         menuItem -e
  420.             -l "Smooth Curve"
  421.             -annotation "Smooth Curve: Select control vertices on curve"
  422.             smoothItem;
  423.         menuItem -e
  424.             -annotation "Smooth Curve Option Box"
  425.             -l "Smooth Curve Option Box"
  426.             smoothDialogItem;
  427.     }
  428.  
  429.     if( `optionVar -q modelWithToolCvHardness` ) {
  430.         menuItem -e
  431.             -l "CV Hardness Tool"
  432.             -annotation "CV Hardness Tool: Select control vertices on curve"
  433.             hardenItem;
  434.         menuItem -e
  435.             -annotation "CV Hardness Tool Option Box"
  436.             -l "CV Hardness Tool Option Box"
  437.             hardenDialogItem;
  438.     }
  439.     else {
  440.         menuItem -e
  441.             -l "CV Hardness"
  442.             -annotation "CV Hardness: Select control vertices on curve"
  443.             hardenItem;
  444.         menuItem -e
  445.             -annotation "CV Hardness Option Box"
  446.             -l "CV Hardness Option Box"
  447.             hardenDialogItem;
  448.     }
  449.  
  450.     if( `optionVar -q modelWithToolProjectTangent` ) {
  451.         menuItem -e
  452.             -l "Project Tangent Tool" 
  453.             -annotation ("Project Tangent Tool: Select three curves " +
  454.                          "OR any number of curves and one surface")
  455.             projectTangentItem;
  456.         menuItem -e
  457.             -annotation "Project Tangent Tool Option Box"
  458.             -l "Project Tangent Tool Option Box"
  459.             projectTangentDialogItem;
  460.     }
  461.     else {
  462.         menuItem -e
  463.             -l "Project Tangent" 
  464.             -annotation ("Project Tangent: Select three curves " +
  465.                          "OR any number of curves and one surface")
  466.             projectTangentItem;
  467.         menuItem -e
  468.             -annotation "Project Tangent Option Box"
  469.             -l "Project Tangent Option Box"
  470.             projectTangentDialogItem;
  471.     }
  472. }
  473.  
  474. global proc ModEditCurvesMenu( string $parent )
  475. {
  476.     // If this ever changes to true, we have to make sure
  477.     // we don't dim the tools.  So, don't just change the
  478.     // value.  Milan S.
  479.     int $dimWhenNoSelect = 0;
  480.  
  481.     int $hasSurfaces = `isTrue SurfaceUIExists`;
  482.  
  483.     setParent -m $parent;
  484.     if( `menu -q -ni $parent` != 0 ) {
  485.         //
  486.         //    Menu is built already - just relabel and return
  487.         //
  488.         modEditCurvesMenuLabel( $hasSurfaces );
  489.         return;
  490.     }
  491.  
  492.  
  493.     // Duplicate Surface Curves.
  494.     //
  495.  
  496.     if( $hasSurfaces ) {
  497.         menuItem
  498.             -c "DuplicateCurve"
  499.             -dmc "duplicateCurveToolScript 2"
  500.             -i "duplicateCurve.xpm"
  501.             duplicateCurveItem ;
  502.         menuItem -optionBox true
  503.             -i "duplicateCurve.xpm"
  504.             -c "DuplicateCurveOptions"
  505.             duplicateCurveDialogItem;
  506.         if( $dimWhenNoSelect )
  507.             dimWhen -f "SomethingSelected" ($parent+"|duplicateCurveItem");
  508.  
  509.         menuItem -d true ;
  510.     }
  511.  
  512.     // Attach, Detach, Align, Open(close)
  513.     //
  514.  
  515.     menuItem
  516.         -c "AttachCurve"
  517.         -dmc "attachCrvToolScript 2"
  518.         -i "attachCurves.xpm"
  519.         attachCrvItem;
  520.     menuItem -optionBox true
  521.         -i "attachCurves.xpm"
  522.         -c "AttachCurveOptions"
  523.         attachCrvDialog;
  524.     if( $dimWhenNoSelect )
  525.         dimWhen -f "SomethingSelected" ($parent+"|attachCrvItem");
  526.  
  527.     menuItem
  528.         -c "DetachCurve"
  529.         -dmc "detachCurveToolScript 2"
  530.         -i "detachCurve.xpm"
  531.         detachItem;
  532.     menuItem -optionBox true -i "detachCurve.xpm"
  533.         -c "DetachCurveOptions"
  534.         detachDialog;
  535.     if( $dimWhenNoSelect )
  536.         dimWhen -f "SomethingSelected" ($parent+"|detachItem");
  537.  
  538.     menuItem -l "Align Curves" 
  539.         -c "AlignCurve"
  540.         -dmc "alignCurveToolScript 2"
  541.         -i "alignCurve.xpm"
  542.         alignItem;
  543.     menuItem -optionBox true 
  544.         -i "alignCurve.xpm" 
  545.         -c "AlignCurveOptions"
  546.         alignDialogItem;
  547.     if( $dimWhenNoSelect )
  548.         dimWhen -f "SomethingSelected" ($parent+"|alignItem");
  549.  
  550.     menuItem -l "Open/Close Curves"
  551.         -c "OpenCloseCurve"
  552.         -dmc "closeCurveToolScript 2"
  553.         -i "closeGeom.xpm"
  554.         closeItem;
  555.     menuItem -optionBox true -i "closeGeom.xpm"
  556.         -c "OpenCloseCurveOptions"
  557.         closeDialogItem;
  558.     if( $dimWhenNoSelect )
  559.         dimWhen -f "SomethingSelected" ($parent+"|closeItem");
  560.  
  561.     // move seam mel script
  562.     //
  563.     menuItem -l "Move Seam" 
  564.         -annotation "Move seam on a periodic curve: Select curve point for new seam location"
  565. //        -image ""  // Needs to have an icon created for it
  566.         -c "moveNurbsCurveSeam" moveCurveSeamItem;
  567.  
  568.     menuItem -d true ;
  569.  
  570.     // cut + intersect + curve fillet.
  571.     //
  572.  
  573.     menuItem
  574.         -c "CutCurve"
  575.         -dmc "cutCurveToolScript 2"
  576.         -i "cutCurves.xpm"
  577.         cutCurvesItem;
  578.     menuItem -optionBox true -i "cutCurves.xpm"
  579.         -c "CutCurveOptions"
  580.         cutCurveDialogItem;
  581.     if( $dimWhenNoSelect )
  582.            dimWhen -f "SomethingSelected" ($parent+"|cutCurvesItem");
  583.  
  584.     menuItem
  585.         -c "IntersectCurve"
  586.         -dmc "intersectCurveToolScript 2"
  587.         -i "intersectCurves.xpm"
  588.         intersectCurvesItem;
  589.     menuItem -optionBox true -i "intersectCurves.xpm"
  590.         -c "IntersectCurveOptions"
  591.         intersectCurveDialogItem;
  592.     if( $dimWhenNoSelect )
  593.            dimWhen -f "SomethingSelected" ($parent+"|intersectCurvesItem");
  594.  
  595.     menuItem
  596.         -c "CurveFillet"
  597.         -dmc "filletCurveToolScript 2"
  598.         -i "fillet.xpm"
  599.         crvFilletItem;
  600.     menuItem -optionBox true  -i "fillet.xpm"
  601.         -c "CurveFilletOptions"
  602.         crvFilletDialogItem;
  603.     if( $dimWhenNoSelect )
  604.         dimWhen -f "SomethingSelected" ($parent+"|crvFilletItem");
  605.  
  606.     menuItem -d true ;
  607.  
  608.     // Insert + Extend + Offset + reverse.
  609.     //
  610.     menuItem
  611.         -c "InsertKnot"
  612.         -dmc "insertCurveToolScript 2"
  613.         -i "insertKnot.xpm"
  614.         insertItem;
  615.     menuItem -optionBox true -i "insertKnot.xpm"
  616.         -c "InsertKnotOptions"
  617.         insertDialog;
  618.     if( $dimWhenNoSelect )
  619.         dimWhen -f "SomethingSelected" ($parent+"|insertItem");
  620.  
  621.     if( $hasSurfaces ) {
  622.         menuItem -l "Extend " -sm 1 -to 1 -aob true;
  623.     }
  624.         menuItem
  625.             -c "ExtendCurve"
  626.             -dmc "extendCurveToolScript 2"
  627.             -i "extend.xpm"
  628.             extendCurveItem;
  629.         menuItem -optionBox true -i "extend.xpm"
  630.             -c "ExtendCurveOptions"
  631.             extendCurveDialogItem;
  632.         if( $dimWhenNoSelect )
  633.             dimWhen -f "SomethingSelected" ($parent+"|extendCurveItem");
  634.  
  635.     if( $hasSurfaces ) {
  636.         menuItem -l "Extend Curve On Surface"
  637.             -c "ExtendCurveOnSurface"
  638.             -dmc "extendCosCurveToolScript 2"
  639.             -i "extendCos.xpm"
  640.             extendCosCurveItem;
  641.         menuItem -optionBox true -i "extendCos.xpm"
  642.             -c "ExtendCurveOnSurfaceOptions"
  643.             extendCosCurveDialogItem;
  644.         if( $dimWhenNoSelect )
  645.             dimWhen -f "SomethingSelected" ($parent+"|extendCosCurveItem");
  646.         setParent -m .. ;
  647.     }
  648.  
  649.     if( $hasSurfaces ) {
  650.         menuItem -l "Offset" -sm 1 -to 1 -aob true;
  651.     }
  652.         menuItem
  653.             -c "OffsetCurve"
  654.             -dmc "offsetCurveToolScript 2"
  655.             -i "offsetCurve.xpm"
  656.         offsetCrvItem;
  657.  
  658.         menuItem -optionBox true -i "offsetCurve.xpm"
  659.             -c "OffsetCurveOptions"
  660.             offsetCurveDialogItem;
  661.  
  662.         if( $dimWhenNoSelect )
  663.             dimWhen -f "SomethingSelected" ($parent+"|offsetCrvItem");
  664.  
  665.     if( $hasSurfaces ) {
  666.         menuItem
  667.             -c "OffsetCurveOnSurface"
  668.             -dmc "offsetCosToolScript 2"
  669.             -i "offsetCos.xpm"
  670.             offsetCosItem;
  671.         menuItem -optionBox true -i "offsetCos.xpm"
  672.             -c "OffsetCurveOnSurfaceOptions"
  673.             offsetCosDialogItem;
  674.             if( $dimWhenNoSelect )
  675.             dimWhen -f "SomethingSelected" ($parent+"|offsetCosItem");
  676.         setParent -m ..;
  677.     }
  678.  
  679.     menuItem
  680.         -c "ReverseCurve"
  681.         -dmc "reverseCurveToolScript 2"
  682.         -i "reverse.xpm"
  683.         reverseItem;
  684.  
  685.     menuItem -optionBox true -i "reverse.xpm"
  686.         -c "ReverseCurveOptions"
  687.         reverseDialogItem;
  688.     if( $dimWhenNoSelect )
  689.         dimWhen -f "SomethingSelected" ($parent+"|reverseItem");
  690.     menuItem -d true ;
  691.  
  692.  
  693.     // rebuild curve
  694.     //
  695.     menuItem
  696.         -c "RebuildCurve"
  697.         -dmc "rebuildCurveToolScript 2"
  698.         -i "rebuildCurve.xpm"
  699.         rebuildCrvItem;
  700.     menuItem -optionBox true -i "rebuildCurve.xpm"
  701.         -c "RebuildCurveOptions"
  702.         rebuildCurveDialogItem;
  703.     if( $dimWhenNoSelect )
  704.         dimWhen -f "SomethingSelected" ($parent+"|rebuildCrvItem");
  705.  
  706.     menuItem -d true ;
  707.  
  708.     // fit B-spline + smooth + cv Hardness.
  709.     //
  710.  
  711.     menuItem
  712.         -c "FitBSpline"
  713.         -dmc "fitBsplineToolScript 2"
  714.         -i "fitBSpline.xpm"
  715.         fitBsplineItem;
  716.  
  717.     menuItem -optionBox true -i "fitBSpline.xpm"
  718.         -c "FitBSplineOptions"
  719.         fitBsplineDialogItem;
  720.  
  721.     if( $dimWhenNoSelect )
  722.         dimWhen -f "SomethingSelected" ($parent+"|fitBsplineItem");
  723.  
  724.  
  725.     menuItem
  726.         -c "SmoothCurve"
  727.         -dmc "smoothCurveToolScript 2"
  728.         -i "smoothCurve.xpm"
  729.         smoothItem;
  730.     menuItem -optionBox true
  731.         -c "SmoothCurveOptions"
  732.         -i "smoothCurve.xpm"
  733.         smoothDialogItem;
  734.     if( $dimWhenNoSelect )
  735.         dimWhen -f "SomethingSelected" ($parent+"|smoothItem");
  736.  
  737.     menuItem
  738.         -c "CVHardness"
  739.         -dmc "cvHardnessToolScript 2"
  740.         -i "cvHardness.xpm"
  741.         hardenItem;
  742.     menuItem -optionBox true
  743.         -c "CVHardnessOptions"
  744.         -i "cvHardness.xpm"
  745.         hardenDialogItem;
  746.     if( $dimWhenNoSelect )
  747.         dimWhen -f "SomethingSelected" ($parent+"|hardenItem");
  748.  
  749.     menuItem -d true ;
  750.  
  751.     // add points + edit curve.
  752.     //
  753.     menuItem -l "Add Points Tool" 
  754.         -annotation "Add Points Tool: Select the curve to add points"
  755.         -image "curveAddPt.xpm"
  756.         -c "AddPointsTool" crvAppendItem;
  757.     menuItem -l "Curve Editing Tool"
  758.         -annotation "Curve Editing Tool: Select a curve or curve on surface"
  759.         -image "curveEditor.xpm"
  760.         -c "CurveEditTool" crvEditorItem;
  761.  
  762.     menuItem -d true;
  763.  
  764.     // project Tangent
  765.     //
  766.     menuItem
  767.         -c "ProjectTangent"
  768.         -dmc "projectTangentToolScript 2" 
  769.         -i "projectTangent.xpm"
  770.         projectTangentItem;
  771.     menuItem -optionBox true 
  772.         -i "projectTangent.xpm" 
  773.         -c "ProjectTangentOptions" 
  774.         projectTangentDialogItem;
  775.     if( $dimWhenNoSelect )
  776.         dimWhen -f "SomethingSelected" ($parent+"|projectTangentItem");
  777.  
  778.     modEditCurvesMenuLabel( $hasSurfaces );
  779. }
  780.  
  781.